package com.ry.rabbitmq.receive;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues="simple-queue")
public class QueueReceive {

	@RabbitHandler
	public void sendMessage(String msg, Message message) {
		System.out.println("接到的消息 ： "+msg);
//		System.out.println(new String(message.getBody()));
	}
	
}
